{% extends "OspHomeBundle::layout.html.twig" %}

{% block OspHome_body %}
	<h3>Espace perso de {{user.prenom ~ " " ~ user.nom}}</h3>
	<hr>

	{% if error %}
	<p style="color:red;"><strong>{{error}}</strong></p>
	{% endif %}

	<div class="well form-inline">
		<form method="post" {{ form_enctype(form) }}>
			
			<legend>Modifier un utilisateur</legend>
			<table class="table table-striped">
				<thead>
					<tr>
						<th>Nom</th>
						<td>{{ form_widget(form.nom, { value : user.nom,'attr': {'class': 'input-medium'} }) }}</td>
					</tr>
					<tr>	
						<th>Prénom</th>
						<td>{{ form_widget(form.prenom, { value : user.prenom,'attr': {'class': 'input-medium'} }) }}</td>
					</tr>
					<tr>	
						<th>Adresse</th>
						<td>{{ form_widget(form.adresse, { value : user.adresse,'attr': {'class': 'input-large'} }) }}</td>
					</tr>
					<tr>	
						<th>Code Postal</th>
						<td>{{ form_widget(form.codePostal, { value : user.codePostal,'attr': {'class': 'input-medium'} }) }}</td>
					</tr>
					<tr>	
						<th>Ville</th>
						<td>{{ form_widget(form.ville, { value : user.ville,'attr': {'class': 'input-medium'} }) }}</td>
					</tr>
					<tr>	
						<th>Email</th>
						<td>{{ form_widget(form.email, { value : user.email,'attr': {'class': 'input-medium'} }) }}</td>
					</tr>
					<tr>	
						<th>Téléphone</th>
						<td>{{ form_widget(form.telephone, { value : user.telephone,'attr': {'class': 'input-medium'} }) }}</td>
					</tr>
					<tr>	
						<th>Mot de passe</th>
						<td>{{ form_widget(form.password, {'attr': {'class': 'input-medium'} }) }}</td>
					</tr>
					<tr>	
						<th>Nouveau mot de passe</th>
						<td>{{ form_widget(form.newPassword, {'attr': {'class': 'input-medium'} }) }}</td>
					</tr>		
				</thead>
			</table>
			<input type="submit" class="btn btn-primary" value="Modifier" style="margin-left:65%" />
			<a href="{{ path('osp_home_homepage') }}" class="btn btn-primary">Annuler<a/>
			{{ form_rest(form) }}
		</form>
	</div>

{% endblock %}